<?php

namespace plugin\admin\app\service\v1;

use plugin\admin\app\constant\v1\CommonConstant;
use plugin\admin\app\model\V1Line;

/**
 * 线路服务类
 **/
class LineService
{

    /**
     * 列表
     *
     * @param array $field
     * @param array $where
     **/
    public static function select($field = ['*'],$where = [])
    {
        $query = V1Line::where('deleted', CommonConstant::DELETE_0)
            ->where($where)
            ->select($field)
            ->orderBy('weight', 'desc')
            ->get();
        $list = $query->toArray();
        $line_column = $query->keyBy('id')->toArray();
        return [$list, $line_column];
    }

}
